require 'protobuf/rpc/server'
require 'protobuf/rpc/handler'
require '<%= required_file %>'

<%- rpcs.each do |name, request, response| -%>
class <%= module_name %>::<%= Util.modulize(name) %>Handler < Protobuf::Rpc::Handler
  request <%= module_name %>::<%= Util.modulize(request) %>
  response <%= module_name %>::<%= Util.modulize(response) %>

  def self.process_request(request, response)
    # TODO: edit this method
  end
end

<%- end -%>
class <%= module_name %>::<%= Util.modulize(service_name) %> < Protobuf::Rpc::Server
  def setup_handlers
    @handlers = {
      <%- rpcs.each do |name, | -%>
      :<%= Util.underscore(name) %> => <%= module_name %>::<%= Util.modulize(name) %>Handler,
      <%- end -%>
    }
  end
end

